package com.aspose.cells.a.c;

import com.aspose.cells.Color;
import com.aspose.cells.ImageFormat;
import com.aspose.cells.a.d.zbn;

public class zd {
   private com.aspose.cells.b.a.b.za a;
   private int b;

   public zd(int var1, int var2) {
      this.a(zbn.a(var1, var2));
   }

   public zd(byte[] var1) throws Exception {
      this.a(new com.aspose.cells.b.a.b.za(new com.aspose.cells.b.a.d.zh(var1)));
   }

   public zd(com.aspose.cells.b.a.b.zx var1) {
      this.a((com.aspose.cells.b.a.b.za)var1.a());
   }

   private void a(com.aspose.cells.b.a.b.za var1) {
      this.a = var1;
      this.b = zbn.a(this.a.e());
   }

   public void a() {
      if (this.a != null) {
         this.a.d();
         this.a = null;
      }

   }

   public int b() {
      return this.b;
   }

   public void a(int var1, int var2, Color var3) {
      this.a.a(var1, var2, var3);
   }

   public void a(com.aspose.cells.b.a.d.zm var1, int var2) {
      switch(var2) {
      case 4:
         a(this.a, var1, 80);
         break;
      case 5:
         a(this.a, var1);
         break;
      case 6:
      case 7:
      default:
         throw new IllegalStateException("Cannot save in this image format.");
      case 8:
         a(this.a, var1, 5, false);
      }

   }

   public void b(com.aspose.cells.b.a.d.zm var1, int var2) {
      a(this.a, var1, var2);
   }

   private static void a(com.aspose.cells.b.a.b.za var0, com.aspose.cells.b.a.d.zm var1) {
      try {
         var0.a(var1, ImageFormat.getPng());
      } catch (Exception var3) {
         com.aspose.cells.a.e.zf.a((Throwable)var3);
      }

   }

   private static void a(com.aspose.cells.b.a.b.za var0, com.aspose.cells.b.a.d.zm var1, int var2) {
      try {
         zbn.a(var0, var1, (long)var2);
      } catch (Exception var4) {
         com.aspose.cells.a.e.zf.a((Throwable)var4);
      }

   }

   private static void a(com.aspose.cells.b.a.b.za var0, com.aspose.cells.b.a.d.zm var1, int var2, boolean var3) {
   }
}
